package cn.jhc.bean;

import java.io.Serializable;
import java.sql.*;


public class ShopDBBean implements Serializable {
	//关闭数据库链接
	protected void closeConnection(Connection conn) {
		if(conn!=null){
			try{
				conn.close();
				conn=null;
			}
			catch(SQLException ex){
				ex.printStackTrace();
				
			}
		}
		
	}
	//关闭Statement对象
	protected void closeStatement(Statement stmt){
		if(stmt!=null){
			try{
				stmt.close();
				stmt=null;
			}
			catch(SQLException ex){
				ex.printStackTrace();
			}
		}
	}
	//关闭PreparedStatement对象
	protected void closePreparedStatement(PreparedStatement pstmt){
		if(pstmt!=null){
			try{
				pstmt.close();
				pstmt=null;
			}
			catch(SQLException ex){
				ex.printStackTrace();
			}
		}
	}
	//关闭ResultSet对象
	protected void closeResultSet(ResultSet rs){
		if(rs!=null){
			try{
				rs.close();
				rs=null;
			}
			catch(SQLException ex){
				ex.printStackTrace();
			}
		}
	}
	//得到选择的商品
	

}
